import instance from "./axiosApi"

export const getStoreList = async () => {
    const result = await instance.get('/me-api/grocery-store')
    return result.data
}

export const getUserList = async (page = 1, search = '', filter) => {
    const result = await instance.post(
        `/me-api/members?page=${page}&pageSize=20&search=${search}`,
        filter
    )
    return result.data
}

export const getBirthUserList = async (search = '') => {
    try {
        const result = await instance.post(`/me-api/birthday?search=${search}`)
        return result.data
    } catch (error: any) {
        console.log(error.response)
    }
}

export const getUserInfo = async (userId) => {
    const result = await instance.get(`/me-api/members-detail?id=${userId}`)
    return result.data
}

export const getAnalysisData = async () => {
    const result = await instance.get('http://180.76.236.114:3006/me-api/analysis?time_range=month')
    return result
}